<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <!-- import CSS -->
  <link rel="stylesheet" href="https://cdn.staticfile.org/element-ui/2.15.9/theme-chalk/index.css">
</head>
<body>
<div id="app">
  <el-menu mode="horizontal"
           background-color="#545c64"
           text-color="#fff"
           active-text-color="#ffd04b"
           @select="handleSelect">
    <el-menu-item :index="a.id" v-for="a in arr">{{a.name}}</el-menu-item>
  </el-menu>
</div>
</body>

<!-- import Vue before Element -->
<script src="https://cdn.staticfile.org/vue/2.6.14/vue.min.js"></script>
<!-- import JavaScript -->
<script src="https://cdn.staticfile.org/element-ui/2.15.9/index.min.js"></script>
<script>
  let v = new Vue({
    el: '#app',
    data: function () {
      return {
        arr:[
          {id:1,name:"品牌男装"},
          {id:2,name:"精品女装"},
          {id:3,name:"数码科技"},
          {id:4,name:"医疗药品"}
        ]
      }
    },
    methods:{
      handleSelect(key,keyPath) {
        if (confirm("您确认要点击：:"+key+"吗？")){
          v.$message("成功点击:："+key)
        }
      }
    }
  })
</script>
</html>